CC	=	g++

CFLAGS	= 	-g -O0 -Wall -fPIC

LIBS	=	-lOpenNI 	\
		-lXnVNite 	\
		-lGL 		\
		-lGLU 		\
		-lglut		

INCLUDE_PATH =	-I/usr/include/nite/	\
		-I/usr/include/ni/	\
		-I../../View/UI

EXEC	= AppTest.so

BUILDDIR = ../../build/

OUTPUTDIR = ../../../app/

DEFINE	= -DDEBUG

PREBUILD = UIEngine.o UIComposite.o UILeaf.o UIText.o UIWindow.o
DEPEND = $(addprefix $(OUTPUTDIR),$(EXEC))

all: $(DEPEND) 

$(OUTPUTDIR)%.so:$(BUILDDIR)%View.o $(BUILDDIR)%Model.o $(BUILDDIR)%Preferences.o $(BUILDDIR)%Action.o  $(addprefix $(BUILDDIR),$(PREBUILD))
	$(CC) $^ $(DEFINE) $(LIBS) -Wl,-soname,$@.1 -shared -o $@

$(BUILDDIR)%.o:%.cpp
	$(CC) -o $@ -c $^ $(DEFINE) $(INCLUDE_PATH) $(CFLAGS)

clean:
	rm -f $(BUILDDIR)*.o $(DEPEND)